import datetime
from sqlalchemy import Column, Integer, String, DateTime, Date, Text, JSON
from app.database import Base

class Recipe(Base):
    __tablename__ = "recipes"

    id = Column(Integer, primary_key=True, index=True)
    dish_name = Column(String, index=True)
    log_date = Column(Date, default=datetime.date.today)
    
    ingredients = Column(JSON)
    method = Column(JSON)
    image_urls = Column(JSON, default=[])

    comment = Column(Text, nullable=True)
    self_critique = Column(Text, nullable=True)
    
    created_at = Column(DateTime, default=datetime.datetime.utcnow)
